package com.luxiu.extensionlib.adapter

import android.content.Context
import android.view.View
import android.view.ViewGroup
import android.widget.ArrayAdapter

abstract class AbstractSpinnerAdapter<T>(
    context: Context,
    resource: Int,
    objects: Array<T>
) : ArrayAdapter<T>(context, resource, objects) {

    var mContext = context

    override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
        return initDefaultView(position, convertView, parent)
    }

    override fun getDropDownView(position: Int, convertView: View?, parent: ViewGroup): View {
        return initDropDownView(position, convertView, parent)
    }

    abstract fun initDropDownView(position: Int, convertView: View?, parent: ViewGroup): View

    abstract fun initDefaultView(position: Int, convertView: View?, parent: ViewGroup): View

}